<template>
  <div class>
    <el-card class="ep-card ep-search">
        <el-form :model="searchForm" label-width="80px">
            <el-row :gutter="20">
                <el-col :span="9">
                    <el-form-item label="企业名称" size="small"> 
                        <el-input v-model="searchForm.entName"  placeholder="请输入企业名称"></el-input>
                    </el-form-item>
                </el-col>
              <el-col :span="9">
                <el-button type="primary" size="small" icon="el-icon-search" @click="init">查询</el-button>
              </el-col>
            </el-row>
        </el-form>
    </el-card>
    <el-table :data="tableData" border style="width: 100%" size="mini">
      <el-table-column type="index" label="序号" align="center" width="50">
      </el-table-column>
      <el-table-column prop="entNo" label="企业编号" align="center" width="260">
      </el-table-column>
      <el-table-column prop="entName" label="企业名称" align="center" width="120">
      </el-table-column>
      <el-table-column prop="area" label="所属区域" align="center" width="120">
      </el-table-column>
      <el-table-column prop="uscCode"  align="center" label="统一社会信用代码">
      </el-table-column>
      <el-table-column prop="peoName" align="center" label="法定代表人">
      </el-table-column>
      <el-table-column prop="telephone" align="center" label="联系人电话">
      </el-table-column>
      <el-table-column prop="createUserName" align="center" label="录人员">
      </el-table-column>
      <el-table-column label="操作" align="center" width="100">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">咨询</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-card style="text-align:right;">
      <el-pagination @size-change="sizeChange" @current-change="currentChange" :current-page="currentPage" :page-sizes="[ 10, 20,30, 40]" :page-size="pageSize" background layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
    </el-card>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      total: 0,
      pageSize: 10,
      currentPage: 1,
      tableData: [],
      searchForm: {
                entName: '',
      },
    };
  },
  computed: {},
  mounted() {
    this.init();
  },
  methods: {
    handleClick(row) {
      let path='/proj/projApplymain'
      this.$router.push({
                path: path,
                query: { entId: row.id}
            });

    },
    sizeChange(n) {
      this.pageSize = n;
      this.init();
    },
    currentChange(n) {
      this.currentPage = n;
      this.init();
    },
    init() {
      let params = {
        pageNum: this.currentPage,
        pageSize: this.pageSize,
        entName: this.searchForm.entName,
      };
      this.$api.formPost(  "/api/biz/ent/doGetListByFr", params)
        .then(res => {
          console.log(res);
          if (res.retHead.code === "0000000") {
            this.tableData = res.retBody.list;
            this.total = res.retBody.total;
          }
        });
    }
  },
  created() {}
};
</script>
<style lang='scss' scoped>
</style>